package com.terheyden.pluginLoaderDemo;

import com.terheyden.pluginLoaderDemo.plugins.api.AppEnvironment;

/**
 * Example app logic class.
 */
public class AppLogic implements AppEnvironment {

    /**
     * Output some text.
     */
    @Override
    public void say(String msg) {
        System.out.println(msg);
    }

    /**
     * Simple add function.
     * @return sum of all ints
     */
    @Override
    public int add(int x, int... y) {

        if (y == null) {
            return x;
        }

        for (int i : y) {
            x += i;
        }

        return x;
    }
}
